package com.example.jwt.entity;

import com.example.user.entity.User;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.Set;

/**
 * @author: mtl
 * @Date: 2022/1/17 10:47
 * @Description:
 */
@Data
@Accessors(chain = true)
public class TokenUser {

    private String username;

    private String password;

    private String token;

    private String salt;

    private Set<String> roles;

    public static TokenUser copy(User user){
        TokenUser loginUser = new TokenUser();
        loginUser.setUsername(user.getName()).setPassword(user.getPassword());
        return loginUser;
    }
}
